package com.wxmblog.photo.common.rest.request.product.admin;

import com.wxmblog.base.common.annotation.ForeignTable;
import com.wxmblog.base.file.annotation.FileSave;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @program: fast
 * @description:
 * @author: Mr.Wang
 * @create: 2023-06-20 17:07
 **/

@Data
public class EditProductRequest {

    @ApiModelProperty(value = "id 无添加 有修改")
    private Integer id;

    /**
     * 标题
     */
    @ApiModelProperty(value = "标题")
    @NotBlank
    private String title;

    /**
     * 文件地址
     */
    @ApiModelProperty(value = "文件地址")
    @FileSave(table = "product", field = "file")
    @NotBlank
    private String file;
    /**
     * 分类
     */
    @ApiModelProperty(value = "分类")
    @NotNull
    @ForeignTable(value = "category", message = "分类不存在")
    private Integer categoryId;
    /**
     * 标签
     */
    @ApiModelProperty(value = "标签")
    private List<String> label;

    @ApiModelProperty(value = "排序")
    private Integer sort;
}
